$of document.ready of function of {} does not execute the initialization script

  • 2020-03-30 03:25:04
  • OfStack

Today I found a page that never executes the initialization script. The code is as follows:


<script type="text/javascript" src="Script/jquery-1.11.1.min.js" />
<script type="text/javascript">
$(document).ready(function() {
alert(1);
});
</script>

Later, it was found that the problem was only caused by the closed writing problem when referring to JQuery, and only the closed method needed to be modified, as shown below:


<script type="text/javascript" src="Script/jquery-1.11.1.min.js" />

Instead of


<script type="text/javascript" src="Script/jquery-1.11.1.min.js"></script>

For reasons unknown...


Related articles: